package com.accenture.fd.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import com.accenture.fd.entity.SrcType;
import com.accenture.fd.entity.UploadFileForClassListEntity;

@Mapper
public interface GetSrcTypeDao {

	     @Select("SELECT class_id ,class_type ,class_comment,create_status,processing_id,class_pakage,responsibility FROM TB00012 where screen_id  = #{screenid}")
	     @Results({
	    	     @Result(property = "classId", column = "class_id"),
	    	     @Result(property = "classType", column = "class_type"),
	             @Result(property = "classComment", column = "class_comment"),
	             @Result(property = "createStatus", column = "create_status"),
	             @Result(property = "processingId", column = "processing_id"),
	             @Result(property = "classPakage", column = "class_pakage"),
	             @Result(property = "responsibility", column = "responsibility"),
	     })
	     List<SrcType> findById(@Param("screenid") String screenid);
	     
	     @Insert({
	    	 "<script>",
	    	 "insert into TB00012 value ",
	    	 "<foreach collection='entityList' item='entity' index='index' separator=','>",
	    	 "(#{entity.screen_id},#{entity.class_id},#{entity.processing_id},#{entity.class_type},#{entity.class_pakage},",
	    	 "#{entity.class_comment},#{entity.responsibility},#{entity.create_status})",
	    	 "</foreach>",
	    	 "</script>"
	     })
	     void save(@Param(value="entityList") List<UploadFileForClassListEntity> uploadFileForClassListEntityList);
}